﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EShop.Client
{
    public partial class frmLockSetPassword : frmBase
    {
        public frmLockSetPassword()
        {
            InitializeComponent();
        }
        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            string p1 = txtP1.Text.Trim();
            string p2 = txtP2.Text.Trim();
            lblMsg.Visible = false;
            if (string.IsNullOrEmpty(p1))
            {
                lblMsg.Visible = true;
                lblMsg.Text = "请输入锁屏密码";
                txtP1.Focus();
                return;
            }
            if (string.IsNullOrEmpty(p2))
            {
                lblMsg.Visible = true;
                lblMsg.Text = "请再次输入锁屏密码";
                txtP2.Focus();
                return;
            }
            if (p2.Equals(p1) == false)
            {
                lblMsg.Visible = true;
                lblMsg.Text = "两次密码输入不一致";
                txtP2.SelectAll();
                txtP2.Focus();
                return;
            }
            lockPassword = p1;
            this.DialogResult = DialogResult.OK;
        }

    }
}
